//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#include <core.h>
#include <_hal.h>

#if defined(_UDBAGENT)
void StubContext::SetupUdbContext(InterruptContext *pCxt,
    StubContext *pUdbCxt)
{
    pUdbCxt->r0 = pCxt->r0;
    pUdbCxt->r1 = pCxt->r1;
    pUdbCxt->r2 = pCxt->r2;
    pUdbCxt->r3 = pCxt->r3;
    pUdbCxt->r4 = pCxt->r4;
    pUdbCxt->r5 = pCxt->r5;
    pUdbCxt->r6 = pCxt->r6;
    pUdbCxt->r7 = pCxt->r7;
    pUdbCxt->r8 = pCxt->r8;
    pUdbCxt->r9 = pCxt->r9;
    pUdbCxt->r10 = pCxt->r10;
    pUdbCxt->r11 = pCxt->r11;
    pUdbCxt->r12 = pCxt->r12;
    pUdbCxt->sp = pCxt->sp;
    pUdbCxt->lr = pCxt->lr;
    pUdbCxt->pc = pCxt->pc;
    pUdbCxt->cpsr = pCxt->cpsr;
}

void StubContext::RestoreUdbInterruptContext(InterruptContext *pCxt,
    StubContext *pUdbCxt)
{
    pCxt->r0 = pUdbCxt->r0;
    pCxt->r1 = pUdbCxt->r1;
    pCxt->r2 = pUdbCxt->r2;
    pCxt->r3 = pUdbCxt->r3;
    pCxt->r4 = pUdbCxt->r4;
    pCxt->r5 = pUdbCxt->r5;
    pCxt->r6 = pUdbCxt->r6;
    pCxt->r7 = pUdbCxt->r7;
    pCxt->r8 = pUdbCxt->r8;
    pCxt->r9 = pUdbCxt->r9;
    pCxt->r10 = pUdbCxt->r10;
    pCxt->r11 = pUdbCxt->r11;
    pCxt->r12 = pUdbCxt->r12;
    pCxt->sp = pUdbCxt->sp;
    pCxt->lr = pUdbCxt->lr;
    pCxt->pc = pUdbCxt->pc;
    pCxt->cpsr = pUdbCxt->cpsr;
}
#endif //if defined(_UDBAGENT)

#if defined(_KDBAGENT)
void StubContext::SetupKdbContext(InterruptContext *pCxt,
    StubContext *pKdbCxt)
{
    pKdbCxt->r0 = pCxt->r0;
    pKdbCxt->r1 = pCxt->r1;
    pKdbCxt->r2 = pCxt->r2;
    pKdbCxt->r3 = pCxt->r3;
    pKdbCxt->r4 = pCxt->r4;
    pKdbCxt->r5 = pCxt->r5;
    pKdbCxt->r6 = pCxt->r6;
    pKdbCxt->r7 = pCxt->r7;
    pKdbCxt->r8 = pCxt->r8;
    pKdbCxt->r9 = pCxt->r9;
    pKdbCxt->r10 = pCxt->r10;
    pKdbCxt->r11 = pCxt->r11;
    pKdbCxt->r12 = pCxt->r12;
    pKdbCxt->sp = pCxt->sp;
    pKdbCxt->lr = pCxt->lr;
    pKdbCxt->pc = pCxt->pc;
    pKdbCxt->cpsr = pCxt->cpsr;
    //InterruptContext.h  has no member named fps
    //pKdbCxt->fps = pCxt->fps;
}

void StubContext::RestoreKdbInterruptContext(InterruptContext *pCxt,
    StubContext *pKdbCxt)
{
    pCxt->r0 = pKdbCxt->r0;
    pCxt->r1 = pKdbCxt->r1;
    pCxt->r2 = pKdbCxt->r2;
    pCxt->r3 = pKdbCxt->r3;
    pCxt->r4 = pKdbCxt->r4;
    pCxt->r5 = pKdbCxt->r5;
    pCxt->r6 = pKdbCxt->r6;
    pCxt->r7 = pKdbCxt->r7;
    pCxt->r8 = pKdbCxt->r8;
    pCxt->r9 = pKdbCxt->r9;
    pCxt->r10 = pKdbCxt->r10;
    pCxt->r11 = pKdbCxt->r11;
    pCxt->r12 = pKdbCxt->r12;
    pCxt->sp = pKdbCxt->sp;
    pCxt->lr = pKdbCxt->lr;
    pCxt->pc = pKdbCxt->pc;
    pCxt->cpsr = pKdbCxt->cpsr;
    //InterruptContext.h  has no member named fps
    //pCxt->fps = pKdbCxt->fps;
}

void SwitchToKdbStack(UInt32 uKdbStack)
{
}
#endif //if defined(_KDBAGENT)
